{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "684f7332-bf5e-432d-a489-3d3280dbf34b",
   "metadata": {},
   "source": [
    "# GReaT colab example\n",
    " \n",
    "**Please make sure you select a runtime with GPU**\n",
    "\n",
    "*(Runtime-> Change Runtime-> Hardware accelerator is set to GPU)*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8dd8767c-90f9-42bd-8c00-2446f49cadc8",
   "metadata": {},
   "outputs": [],
   "source": [
    "!pip install be-great"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5226f2ed-11d6-47c2-b989-175e87940f7d",
   "metadata": {},
   "outputs": [],
   "source": [
    "from be_great import GReaT\n",
    "from sklearn.datasets import fetch_california_housing\n",
    "\n",
    "data = fetch_california_housing(as_frame=True).frame\n",
    "\n",
    "model = GReaT(llm='distilgpt2', batch_size=64, epochs=1, save_steps=400000)\n",
    "model.fit(data)\n",
    "synthetic_data = model.sample(n_samples=100)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
